package net.csdn.business.common.domain.issue.event;

import lombok.*;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;

/**
 * @ClassName: SetPriorityDTO
 * @Description: 设置issue优先级事件
 * @Author: zhangyl
 * @Date: 2024/12/25 10:17
 */
@Data
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
public class SetPriorityDTO extends BaseEventDto {

    private Priority priority;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Priority implements Serializable {
        /**
         * 优先级名称
         */
        private String  name;
        /**
         * 优先级code
         */
        private Integer  code;

        /**
         * 优先级颜色
         */
        private String color;
    }


    public static SetPriorityDTO buildChangeEvent(String id, String actionUid,Integer userType, Priority priority) {
        return SetPriorityDTO.builder()
                .id(id).actionUid(actionUid).actionUserType(userType)
                .priority(priority)
                .build();
    }
}